package com.secneo.appshare.api;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.secneo.appshare.privatemsg.PrivateMsg;
import com.secneo.appshare.remind.Remind;



public interface RemoteApi {
	
	/**
	 * 1.添加用户
	 *    /ap/m/user/newuser
	 */
	public UserInfo addNewUser(Context c, String recomAndroidId, String nickName, String avatar,
			String password,String email,String bnumber,String uid);
	public UserInfo addNewWeiboUser(Context c, int snsType, String wid, String nickname, String avatar);
	
	public static class UserInfo {
		public String nick;
		public String id;
		public String error;
		public String avatar;
		public String androidId;
	}
	
	public static class PushMessage {
		public String pushMessage;
		public String appName;
		public String appIcon;
		public String appPackageName;
		public String pushTitle;
		public String pushYOBOUrl;
		public String pushFirstButton;
		public String pushSecondButton;
		public int pushStatus;
	}
	
	/*
	 * 2.上传应用程序
	 *   ap/m/applist/updateapplist
	 *   
	 */
	
	/**
	 * 3.获得推荐应用程序
	 *
	 *  
	 */
	public List<AppRecom> getRecomsApp(Context c, String uid, int appType, int number);
	public List<AppRecom> getFriendsList(Context c, String uid, int snsType);
	public void getTopList(Context c, String uid, int number, List<AppRecom> downList, List<AppRecom> hotList, 
			List<AppRecom> talkList, List<AppRecom> promoteList, List<AppRecom> goodList);
	public static class AppRecom {
		public String app_name;
		public String package_name;
		public String app_icon;
		public int app_type;
		public String price;
		public Drawable app_icon_drawable;
	}
	
	public static class Medals {
		public String name;
		public boolean hasit;
	}
	
	/**
	 * 上传社区用户关注列表
	 */
	public boolean uploadFollowedFriends(Context c, String uid, List<String> uidList);
	

	public boolean uploadRequestAttent(Context c, String uid, List<String> uidList);
	public boolean uploadRejectAttent(Context c, String uid, List<String> uidList);
	
	/**
	 * 获得最新活动列表
	 */
	public List<LatestActivity> getLatestActivity(Context c, String uid, int number,String time);
	public static class LatestActivity {
		public String user_name;
		public String user_id;
		public String user_icon;
		public String date;
		public int action_type;
		public String comments;
		public String app_name;
		public String app_icon;
		public String app_pckName;
		public Drawable user_icon_drawable;
		public Drawable app_icon_drawable;
		public String time;
		public int sns_type;
	}
	
	/**
	 * 获得某用户活动列表
	 */
	public List<UserActivity> getUserActivity(Context c, String uid, int number);
	public static class UserActivity {
		public String date;
		public int action_type;
		public String comments;
		public String app_name;
		public String app_icon;
		public String app_pckName;
		public Drawable app_icon_drawable;
	}
	
	/**
	 * 获得广场用户列表/获得用户粉丝列表/获得用户关注列表
	 */
	public Feeds getFeeds(Context c, String uid, String feed_type, int number);

	/**
	 * 获得“你关注的人中”还未关注你的人
	 */
	public Feeds getNotAttentFeeds(Context c, String uid, int number);

	/**
	 * 获得“请求你关注”的用户列表
	 */
	public Feeds getNeedAttentFeeds(Context c, String uid, int number);

	/**
	 * 获得使用最多的手机型号列表
	 */
	public List<String> getTopPhones(Context c, int number);
	
	/**
	 * 获得广场同机型用户列表
	 */
	public Feeds getFeedsByPhone(Context c, String uid, int number, String phoneType);
	
	public static class Feed {
		public int type;
		public String uid;
		public String app_price;
		public String package_name;
		public String text;
		public String app_icon;
		public String is_community;
		public String when;
		public int snsType;
		public String app_name;
		public String user_name;
		public String user_icon;
		public Drawable user_icon_drawable;
		public boolean is_new ;		//if new flower
		public int is_attent = 0;
		public int is_fans = 0;
		public boolean box_checked = true;
	}
	public static class Feeds {
		public boolean fb_invite_popup;
		public int msgs;
		public List<Feed> feeds;
		public int total;
		public int fansTotal;
		public int attentTotal;
	}
	
	
	/**
	 * 获得某一个应用程序的信息，包括有多少人使用
	 */
	public AppInfo getApplicationInfo(Context c, String package_name, int number, String uid,
			boolean installed_not_addicted);
	public CommentInfo getApplicationComments(Context c, String package_name, int number, String uid,
			boolean installed_not_addicted, int count, String timeStamp);
	public AppInfoUserInfo getApplicationUsers(Context c, String package_name, int number, String uid,
			boolean installed_not_addicted, int count, String timeStamp);
	public static class AppInfoUserInfo{
		public String status ;
		public String timeStamp ;
		public ArrayList<Feed> userList ;	
	}
	public static class AppInfoUser {
		public String uid;
		public int action;
		public String uname;
		public int snsType;
		public String icon_url;
		public Drawable icon_drawable;
	}
	public static class CommentInfo{
		public String status ;
		public String timeStamp ;
		public ArrayList<Comment> commentList ;
	}
	public static class Comment {
		public String comment;
		public String uid;
		public String uname;
		public int rating;
		public String user_icon;
		public String date ;
		public Drawable user_icon_drawable;
	}
	public static class AppDetails {
		public String category;
		public int app_type;
		public String download_url;
		public String package_name;
		public boolean is_active;
		public boolean hide;
		public double rating;
		public String description;
		public String icon_url;
		public String price;
		public String name;
		public String app_size;
		public String app_version;
		public Drawable iconDrawable;
		public ArrayList<Drawable> shortDrawableList ;
		public ArrayList<String> shortUrlList ;
		public String hotcount;
		public int downloadCount ;
		public int userCount ;
		public boolean hotflag;
	}
	
	
	public static class AppInfo {
		public String status;
		public AppDetails appDetails;
	}
	
	public OtherUserApps getOtherUserApps(Context c, String uid, String other_uid);
	
	public static class OtherUserApp {
		public String package_name;
		public String action;
		public String icon_url;
		public String price;
		public String name;
		public Drawable icon_drawable;
		public boolean selfAppFlag=false;
	}
	
	public static class OtherUserApps {
		public String status;
		public List<OtherUserApp> otherUserAppList;
		public int numInstall;
		public int numShare;
		public int numFollowed;
		public int numFollower;
		public int relation;
		public int medalNum;
		public List<String> medals_url;
		public String uname;
		public int snsType;
		public String phoneType;
	}
	
	public void sendDownloadAction(Context c, String appName);
	public void sendDownLog(Context c, String appName, String shopName);
	public String sendShareAction(Context c, String appName);
	
	// 关注/取消关注某用户
	public boolean followSomeone(Context c, String other_uid, boolean isFollow);
	
	// 获取24小时以内最热的关键词
	public int getHotKeyword(Context c, int count, List<String> wordList);
	
	// 获取梆梆用户的邮箱地址
	public String getEmail(Context c, String userId);

	// 向服务器发送当前登录的社区账号信息
	public boolean sendSnsInfo(Context c, String userId, 
			String snsUserName, String snsIconUrl, int snsType);
	

	// 向服务器发送消息取消当前社区账号绑定
	public boolean destroySNSAccount(Context c, String userId, int snsType);
	

	// 向服务器发送消息注销并销毁当前梆梆账号，同时取消和所有社区的绑定
	public boolean destroyBangAccount(Context c, String userId);
	
	/**
	 * 发送私信
	 * @param f_uid 发信人uid
	 * @param t_uid 收信人uid
	 * @param data 信息内容
	 * @return -1 失败  1 成功
	 * */
	public int sendMsg(String f_uid, String t_uid, String data) ;
	/**
	 * 收取私信
	 * @param uid
	 * @return 私信列表 
	 * */
	public ArrayList<PrivateMsg> recieveMsg(Context c , String uid , int pageIndex) ;
	/**
	 * 收取私信 by uid
	 * @param uid
	 * @param o_uid
	 * @return 私信列表 
	 * */
	public ArrayList<PrivateMsg> recieveMsgByUid(Context c , 
			String uid , String o_uid , int pageIndex) ;
	/**
	 * 获取当前新私信、新提醒和新粉丝个数
	 * @param uid
	 * @param newSmsCount newActivityCount newFanCount   for return
	 * @return -1 失败  1 成功
	 * */
	class News{
		public int newSmsCount ;
		public int newActivityCount ;
		public int newFanCount ;
		public int newHonorCount ;
	}
	public int getNews(String uid , News news) ;
	/**
	 * 删除私信
	 * @param uid
	 * @param msg_uid
	 * @return -1 失败  1 成功
	 * */
	public int deleteMsg(String uid , int msg_uid) ;
	/**
	 * 获取提醒列表
	 * @param uid
	 * @param action
	 * 
	 * */
	public ArrayList<Remind> getRemindList(Context c , String uid, int actionType) ;
	/**
	 * 发表一条腾讯微博带图片
	 * 
	 * */
	public boolean share2QWeiboMsg(Context ctx, int actionType, String msg, byte[] imageBytes, String atWho , String appDes , String pkgName) ;
	/**
	 * 发表一条腾讯微博
	 * 
	 * */
	public boolean share2QWeiboMsg(Context ctx, int actionType, String msg, String atWho ,String appDes , String pkgName) ;
	class BNumberItem{
		public String bnumber ;
		public String uid ;
	}
	/**
	 * 获取安卓号
	 * **/
	public BNumberItem getBNumber() ;
	
	
	/**
	 * 获取注册新浪微博的短信收件人地址
	 * **/
	public String getSinaRegisterNumber(Context c);
}
